<template>
	<view>
		<uni-nav-bar :title="tabIndex === '4' ? '取消详情' : '处理详情'" @clickLeft="back" left-icon="left"
			backgroundColor="#fff" color="#000" statusBar="true">
		</uni-nav-bar>
		<view class="container">
			<scroll-view class="scrollView" scroll-y="true" @scrolltolower="handleScrolltolowerone()"
				:style="{height: setcollapseheight() - 50 + 'px'}">
				<view class="content">
					<view class="time oneline">
						<view class="left">
							预约时间：
						</view>
						<view class="right">
							{{doorToDoorInfo.createTime}}
						</view>
					</view>
					<view class="address oneline">
						<view class="left">
							地址：
						</view>
						<view class="right">
							浙江省湖州市吴兴区旧馆镇大亩担
						</view>
					</view>
					<view class="nickName oneline">
						<view class="left">
							联系人：
						</view>
						<view class="right">
							{{doorToDoorInfo.contact}}
						</view>
					</view>
					<view class="phone oneline">
						<view class="left">
							联系方式：
						</view>
						<view class="right">
							{{doorToDoorInfo.contactMethod}}
						</view>
					</view>
					<view class="remark oneline">
						<view class="left">
							问题描述：
						</view>
						<view class="right">
							{{doorToDoorInfo.content}}
						</view>
					</view>
				</view>
				<view class="img">
					<view v-for="(item,index) in doorToDoorInfo.imgList" :key="index" style="margin-bottom:20rpx;overflow: hidden;">
						<image :src="`${socializedBaseurl}common/file/upDown/view?fileId=${item.imgId}&moduleType=XG_ORGANIZATION&upDownType=FTP`" mode="widthFix"></image>
					</view>
				</view>
				<view class="result">
					<view class="title" v-if="tabIndex === '4'">
						取消详情：
					</view>
					<view class="title" v-else>
						处理详情：
					</view>
					<view class="result-content">
						<view class="name oneline">
							<view class="left">
								处理专家：
							</view>
							<view class="right">
								{{doorToDoorInfo.expertName}}
							</view>
						</view>
						<view class="time oneline">
							<view class="left">
								处理时间：
							</view>
							<view class="right">
								{{doorToDoorInfo.receiveDateTime}}
							</view>
						</view>
						<view class="name oneline">
							<view class="left">
								处理描述：
							</view>
							<view class="right">
								{{doorToDoorInfo.remark}}
							</view>
						</view>
					</view>
					<view class="result-img">
						<view v-for="(item,index) in doorToDoorInfo.videoList" :key="index" style="height: 420rpx;width: 100%;">
							<MyVideo :videoUrl="`${socializedBaseurl}common/file/upDown/videoView?fileId=${item.videoId}&moduleType=XG_ORGANIZATION&upDownType=FTP`"
								style="width: 100%;height: 100%;"></MyVideo>
						</view>
					</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import { socializedBaseurl } from '@/config/baseUrl.js'
	import MyVideo from '@/subPage1/components/myVideo/myVideo.vue'
	export default {
		components: {
			MyVideo
		},
		onLoad(e) {
			this.tabIndex = e.tabIndex
			this.type = e.type
		},
		created() {
			this.doorToDoorInfo = uni.getStorageSync('doorToDoorInfo')
		},
		data() {
			return {
				socializedBaseurl,
				tabIndex: 0,
				doorToDoorInfo: {},
				type: ''
			}
		},
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				})
			},
			setcollapseheight() {
				let winHeight = 0
				let topheightone = uni.upx2px(136)
				uni.getSystemInfo({
					success: function(res) {
						winHeight = res.windowHeight
					}
				})
				winHeight = parseInt(winHeight) - topheightone
				// #ifndef H5
				winHeight = winHeight - 10
				// #endif
				return winHeight
			},
			handleScrolltolowerone() {
				console.log('触底');
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		padding: 20rpx 40rpx;

		.content {
			padding: 20rpx;
			background-color: #fff;

			.oneline {
				display: flex;
				margin-bottom: 10rpx;
				font-size: 28rpx;
			}
		}

		.img {
			width: 100%;

			image {
				width: 100%;
			}
		}

		.result {
			padding-top: 20rpx;
			border-top: 2rpx solid #ccc;

			.title {
				font-weight: 700;
				font-size: 32rpx
			}

			.result-content {
				margin-top: 20rpx;
				font-size: 28rpx;
				padding: 10rpx 20rpx;
				background-color: #fff;

				.oneline {
					display: flex;
					margin-bottom: 10rpx;
				}
			}

			.result-img {
				margin-bottom: 20rpx;
			}
		}
	}
	
	.operate {
		width: 100%;
		position: fixed;
		bottom: 60rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		.btn {
			width: 25%;
		}
		.btn3 {
			width: 25%;
			
		}
	}
	/deep/._iframe {
		width: 99%!important;
		height: 100%!important;
	}
</style>